package com.xu.fountain.Tcp;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class ScoketServer extends Thread
{
    public static void main(String[] args) {

        ServerSocket serversocket = null;

        Socket socket = null;


        int port = 8089;

        try {
            serversocket = new ServerSocket(port);

            while(true){
                //获得连接
                socket = serversocket.accept();
                //启动线程
                new ScoketThread(socket);
            }



        }  catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }finally {
            // TODO: handle finally clause
            try{
                serversocket.close();
            }catch(Exception e){}
        }

    }

}